<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get len bytes data from open blob</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ibase-blob-echo.html">« ibase_blob_echo</a></li>
      <li style="float: right;"><a href="function.ibase-blob-import.html">ibase_blob_import »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ibase.html">Firebird/InterBase 函数</a></li>
    <li>Get len bytes data from open blob</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ibase-blob-get" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_blob_get</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_blob_get</span> &mdash; <span class="dc-title">Get len bytes data from open blob</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ibase-blob-get-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_blob_get</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$blob_handle</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$len</code></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   This function returns at most <code class="parameter">len</code> bytes from a BLOB
   that has been opened for reading by <span class="function"><a href="function.ibase-blob-open.html" class="function">ibase_blob_open()</a></span>.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    It is not possible to read from a BLOB that has been opened for writing
    by <span class="function"><a href="function.ibase-blob-create.html" class="function">ibase_blob_create()</a></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ibase-blob-get-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">blob_handle</code></dt>

     <dd>

      <p class="para">
       A BLOB handle opened with <span class="function"><a href="function.ibase-blob-open.html" class="function">ibase_blob_open()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">len</code></dt>

     <dd>

      <p class="para">
       Size of returned data.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-blob-get-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns at most <code class="parameter">len</code> bytes from the BLOB, or <strong><code>false</code></strong>
   on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ibase-blob-get-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1224">
    <p><strong>示例 #1 <span class="function"><strong>ibase_blob_get()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$result&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;blob_value&nbsp;FROM&nbsp;table"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$data&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_fetch_object</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$blob_data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_blob_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">BLOB_VALUE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$blob_hndl&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_blob_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">BLOB_VALUE</span><span style="color: #007700">);<br />echo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ibase_blob_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$blob_hndl</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$blob_data</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
   Whilst this example doesn&#039;t do much more than a
   &#039;ibase_blob_echo($data-&gt;BLOB_VALUE)&#039; would do, it does show you how to get
   information into a $variable to manipulate as you please. 
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ibase-blob-get-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.ibase-blob-open.html" class="function" rel="rdfs-seeAlso">ibase_blob_open()</a> - Open blob for retrieving data parts</span></li>
    <li class="member"><span class="function"><a href="function.ibase-blob-close.html" class="function" rel="rdfs-seeAlso">ibase_blob_close()</a> - Close blob</span></li>
    <li class="member"><span class="function"><a href="function.ibase-blob-echo.html" class="function" rel="rdfs-seeAlso">ibase_blob_echo()</a> - Output blob contents to browser</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>